/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#ifndef MK_ERROR_CODE_H
#define MK_ERROR_CODE_H
#include "MkUtil/MkTypes.h"

class MkApi CMkErrorCode
{
public:
    typedef struct _error_code_desc
    {
        Uint32		ErrorCode;
        MkString	EnDesc;
        MkString	EnTreatmentMethod;
        MkString	CnDesc;
        MkString	CnTreatmentMethod;
    }ErrorCodeDesc;
public:
    ~CMkErrorCode();

    static CMkErrorCode& GetInstance() { return m_Instance; }

    MkUnorderedMap<Uint32, ErrorCodeDesc>& GetMapErrorCodeDesc() { return m_MapErrorDesc; }
    Uint32 GetErrorcodeDesc(Uint32 ErrorCode, ErrorCodeDesc& Desc);
    Uint32 AddErrorcodeDesc(const ErrorCodeDesc& Desc);

protected:
private:
    CMkErrorCode();

    static CMkErrorCode				        m_Instance;
    MkUnorderedMap<Uint32, ErrorCodeDesc>	m_MapErrorDesc;
};

#endif // !MK_ERROR_CODE_H
